import os.path

from selenium import webdriver
import time
from selenium.webdriver.common.by import By

# 打开浏览器, 请求测试网址
driver = webdriver.Chrome()
url = 'file:///' + os.path.abspath('html') + '\\redio-checkbox.html'
driver.get(url)

# 单击按钮操作
time.sleep(2)
driver.find_element(By.ID, 'boy').click()
print(driver.find_element(By.ID, 'boy').is_enabled())

time.sleep(2)
driver.find_element(By.ID, 'girl').click()
print(driver.find_element(By.ID, 'girl').is_enabled())

# 退出浏览器
time.sleep(2)
driver.quit()